<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //作业2 拆分数字
        var origin = 1685;
        var a = parseInt(origin / 1000)
        var b = parseInt(origin % 1000 / 100)
        var c = parseInt(origin % 100 / 10)
        var d = parseInt(origin % 10)
        console.log(a, b, c, d);


        // function chaifen(num){
        //     var a = num.toString()
        //     for(var i = 0;i < a.length;i++){
        //         console.log(a[i])
        //     }
        // }
        // chaifen(origin)
    </script>
</body>

</html>